
import {createApp} from 'vue'
import TDesign from 'tdesign-vue-next'; // 导入组建
import {createPinia} from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

import App from './App.vue'
import router from '@/router'

import 'tdesign-vue-next/dist/reset.css'; // 引入组件库的重置样式
import 'tdesign-vue-next/es/style/index.css';
// 自定义样式在组件样式之后导入
import "@/assets/less/base.less";

import {permissionDirective} from "@/directives/permission"; // 引入组件库的少量全局样式变量


// 引入 echarts
import ECharts from 'vue-echarts'
// 导入 ECharts 核心组件和渲染器
import * as echarts from 'echarts/core';
import { CanvasRenderer } from 'echarts/renderers';
// 导入需要的图例
import { LineChart ,PieChart, RadarChart} from 'echarts/charts';
import {
    TitleComponent,
    TooltipComponent,
    GridComponent,
    DatasetComponent,
    ToolboxComponent,
    LegendComponent
} from 'echarts/components';
// 注册必要的组件
echarts.use([
    CanvasRenderer,
    LineChart,
    PieChart,
    RadarChart,
    TitleComponent,
    TooltipComponent,
    GridComponent,
    DatasetComponent,
    ToolboxComponent,
    LegendComponent
]);

const app = createApp(App)

app.use(TDesign)

app.component('v-chart', ECharts)

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)
//app.use(createPinia())
app.use(pinia)

app.use(router)
app.directive("permission", permissionDirective);

app.mount('#app')


